home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 23
/
Amiga Format AFCD23 (Feb 1998, Issue 107).iso
/
-seriously_amiga-
/
shareware
/
graphics
/
povray3
/
povray3_060
/
utils
/
netpbm.intro
next >
Wrap
Text File
|
1997-12-12
|
11KB
|
242 lines
NETPBM Image conversion and processing package
Amiga information
Binaries
--------
Binaries are available at ftp.informatik.uni-oldenburg.de [134.106.1.9] in
/pub/netpbm/amiga, or on all Aminet sites in /pub/aminet/gfx/pbm.
The full distribution consists of these archives:
texts.lha REQ textfiles, miscellaneous stuff
manuals.lha REQ formatted Unix manuals
mergedbin.lha REQ* merged binaries
pbmbin.lha REQ* PBM binaries, for B&W images
pgmbin.lha REQ* PGM binaries, for greyscale images
ppmbin1.lha REQ* PPM binaries #1, for color images
ppmbin2.lha REQ* PPM binaries #2, for color images
pnmbin.lha REQ* PNM binaries, tools and special converters
scripts.lha OPT Unix shell scripts
source1.lha DEV source: tools and main libraries
source2.lha DEV source: TIFF library, Unix nroff manuals, VMS stuff
dicelibs.lha DEV compiled link libraries, for DICE
REQ = required, OPT = optional, DEV = only useful for programmers
*: You need either all the p?mbin archives, or just the mergedbin archive.
See the section "Merged binaries vs Separate binaries" for an explanation.
What is NETPBM?
---------------
NETPBM is a revised version of the PBMplus package, containing corrections
and enhancements to the 10dec91 version of PBMplus. It is not "official" in
the sense of being released by the original author, but the idea of a net
supported version has been approved by him.
NETPBM is a collection of tools which do the following:
1. Import - read images in popular formats and convert to one of the
internal PBM formats.
2. Image processing - manipulate the image data to produce many effects
including scaling, contrast and gamma adjustment, edge detection, etc.
3. Export - write images in popular formats for use with other software.
NETPBM uses three intermediate formats:
PBM = `portable bitmap' (black&white)
PGM = `portable gray map' (greyscale, usually 8bit)
PPM = `portable pix map' (color, usually 24bit)
The formats are upward compatible, PGM programs can read both PBM and PGM and
write PGM, PPM programs can read all three and write PPM. There are also PNM
programs (PNM = `portable anymap'), these work on all three formats. The
difference between PPM and PNM programs is that PPM programs always write PPM,
but PNM programs can write any of the three formats (usually they write the
same format as they got as input). There is no PNM format!
The great advantage of using intermediate formats is that for a conversion
between N formats only 2*N converters are needed instead of N^2; and if yet
another graphic format appears, all that is needed are the newtop?m and
p?mtonew filters, and you are immediately able to convert the new format to
and from any other old format. The disadvantage is that two commands are
needed to convert an image:
giftoppm mypic.gif >mypic.ppm
ppmtoilbm -hamif mypic.ppm >mypic.iff
or on Unix-like shells: giftoppm mypic.gif | ppmtoilbm > mypic.iff
Another disadvantage is that the intermediate formats are very simple and
therefore the files get quite big, for example a 1024x768 PPM picture needs
1024*768*3 bytes = 2.25MB.
NETPBM also includes a lot of tools that manipulate the intermediate formats
in some way: scaling, rotating, reducing the number of colors and more. For
example, to convert a GIF of any size to a 320*200 IFF-ILBM you could do this:
giftoppm mypic.gif >mypic.ppm
pnmscale -xysize 320 200 mypic.ppm >mypic.ppm2
ppmtoilbm -hamif mypic.ppm2 >mypic.iff
or giftoppm mypic.gif | pnmscale -xysize 320 200 | ppmtoilbm -hamif >mypic.iff
If you are not using an Unix-like shell, you can use the PIPE: handler to avoid
using temporary files:
run giftoppm mypic.gif >pipe:1
run pnmscale -xysize 320 200 <pipe:1 >pipe:2
run ppmqvga <pipe:2 >pipe:3
ppmtoilbm -aga <pipe:3 >mypic.iff
Requirements
------------
* OS 2.04 or higher, or 1.3 with disk-based mathieeesingbas/mathieeesingtrans
libraries (available from C=).
* mathtrans, mathieeedoubbas and mathieeedoubtrans libraries in LIBS:
A hard disk, a fast CPU, and lots of memory are recommended. It will work on
68000's if you have sufficient memory; on machines with 020+MMU, non-EC 030,
or non-EC 040, a virtual memory program like GigaMem will be useful if you are
processing large images.
A full binary installation takes 1MB of HD space for merged binaries, 3MB for
separate binaries (see below for an explanation). Source (not including
libtiff source, unix nroff manuals and the vms subdir) takes another 3MB.
There is no special 68020/881 binary distribution. The FPU is already used by
the math libraries, and most programs are I/O-bound instead of CPU-bound.
Merged binaries vs Separate binaries
------------------------------------
Netpbm consists of more than 130 programs, each being stand-alone and not
depending on the other programs. This means a lot of disk space is wasted,
since all programs use the same routines for reading, writing, allocation
etc., and the code for these routines has to be in every single program.
To avoid this, the programs can be merged into a single huge executable
(actually four of them) and the individual programs are just hardlinks to
this binary. Both methods have advantages and disadvantages:
Separate binaries:
+ executables can be individually tuned for maximum performance (register
args and small data model are used whenever possible).
+ most executables are "pure" and can be made resident
- full installation takes MUCH more disk space (3MB)
Merged binaries:
+ only 4 executables and a bunch of links. Requires only 1MB of disk space
for a full installation.
- executables are slower, since all have to be compiled with stack-args and
large data model
- executables are huge and require more RAM to execute. This will be fixed
in the future by using overlays.
Why no shared library? Its just too much work. If you think your life depends
on having a pbm.library, go ahead and create it... or pay me for a month or two
of full-time work, and I'm doing it :-)
Installation
------------
Separate binaries:
You need the following archives: pbmbin, pgmbin, ppmbin1, ppmbin2, pnmbin.
Extract the programs that you need from the archives and copy them to a
directory in your search path.
Merged binaries:
You only need the mergedbin archive. Extract the four p?mmerge programs and
copy them to a directory in your search path. Then CD to this directoy and
execute the "link_merged" script. This generates all the hardlinks.
Links are not supported by 1.3, so if you are still running it, you have no
choice but to use the separate binaries. Some 2.x and 3.x filesystems have
bugs with links that trashes the disk if the original file is deleted and a
link still exists. A safe way is to use the merged binaries on these systems
is to install them in their own directory, and if you decide one day to de-
install them do it in this way:
delete ~(#?merge)
delete #?
X11 color names file: Some programs (for example pgmtoppm and ppmmake) can use
a color names file, so you can specify colors by names instead of RGB values.
An example color names file is included in the texts archives, as "RGB.txt".
Just copy the file to a convenient place (S: is a good choice) and set the
environment variable "RGBDEF" to the full path and name of this file:
setenv RGBDEF "s:RGB.txt"
Unix shell scripts: I didn't bother to convert the scripts to AmigaDOS-scripts
(it's almost impossible anyway). If you want to run them, use a Bourne-shell
or Csh clone.
Stack size: Don't worry about it. The programs automatically allocate a
larger stack if they need more.
Memory usage
------------
You can control the way how the programs allocate their memory with the
environment variable "PBMMEM". The following keywords are used:
fast
The programs will not try to allocate chipmem if they run out of fastmem.
If this keyword is not used, then the programs will allocate both fast-
and chipmem (fastmem first).
pool
pool=<n>
With this keyword, the programs use memory pools. This is faster and
avoids run-time memory fragmentation, but unfortunately crashes if used
with GigaMem. Note that OS 3.x is *NOT* required, it works under 2.x
(tested on 2.1) and probably even under 1.3 (not tested). The optional
number selects the size of the pools, the default being 32K. If this
keyword is not used, all allocations are done with normal AllocMem()
calls. This should work on all systems and with virtual memory programs
like GigaMem.
max=<n>
The maximum memory a program allocates. This does not include the memory
used for the code, data and stack segments. The default value (if this
keyword is not used) is "unlimited" (2GB, to be precise).
Multiple keywords are delimited by whitespace or commas. Numbers can be in
decimal, hex (prefix "0x") or octal (prefix "0") and can be given in bytes,
Kbytes (suffix "k") or megabytes (suffix "m").
Example: setenv PBMMEM "pool=64k,fast,max=2M"
Selects allocation via memory pools, fast memory only, and sets the
poolsize to 64KB and the maximum memory usage to 2MB.
Misc info
---------
NETPBM does not include converters for JPEG, but the freely distributable
programs "djpeg" and "cjpeg" can convert JPEG to and from P?M. You can get
them from Aminet:/pub/aminet/gfx/conv, look for an archive called "jpegV?.lha"
or "AmigaJPEG?.lha" or something similar.
The hpcdtoppm included in NETPBM converter is an older version, an up-to-date
version is available on Aminet:/pub/aminet/gfx/pbm, archive "hpcdtoppm*.lha".
All programs have two hidden options, "-version" and "-quiet". The first does
the obvious: it prints version and configuration information of the program.
The other suppresses all messages from the program (unfortunately, some
programs ignore this option). Most programs print usage information if a "-?"
option is given.
Support
-------
Your can reach me via
E-mail:
Ingo.Wilken@informatik.uni-oldenburg.de
IRC:
Nobody (usually on channel "#amigager")
Carrier pigeon and other ancient communication channels:
Ingo Wilken
Bloherfelder Str. 72
26129 Oldenburg
W-Germany
For bug reports, please describe exactly what you were doing, what went wrong
(guru number?) what OS version you are using, your machine configuration, and
everything else that could be important. If possible, provide the following:
* "enforcer" & "mungwall" output
* "showconfig" output
* a sample image that triggers the bug (unless it appears with any image)
* the output of running the NETPBM-program with the -version option
Also, make sure that it's really the NETPBM-program thats causing the problems,
not some background-utility playing corewar.